home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2000 / MacHack 2000.toast / pc / The Hacks / Softshoe / Lisa's Mac Parts / Fonts / FontNumber.cp < prev    next >
Text File  |  2000-06-23  |  629b  |  37 lines

  1. // FontNumber.cp
  2.  
  3. #ifndef FontNumber_h
  4. #include "FontNumber.h"
  5. #endif
  6. #ifndef ConstPString_h
  7. #include "ConstPString.h"
  8. #endif
  9.  
  10. #include <Fonts.h>
  11.  
  12. FontNumber::FontNumber( int16 value )
  13.   : number( ( value == systemFont )
  14.                       ? System().Value()
  15.                       : ( value == applFont )
  16.                           ? Application().Value()
  17.                           : value )
  18.   {
  19.   }
  20.  
  21. FontNumber::FontNumber( ConstPString name )
  22.   {
  23.     GetFNum( name, &number );
  24.   }
  25.  
  26. FontNumber FontNumber::System()
  27.   {
  28.     static int16 font = GetSysFont();
  29.     return FontNumber( font );
  30.   }
  31.  
  32. FontNumber FontNumber::Application()
  33.   {
  34.     static int16 font = GetAppFont();
  35.     return FontNumber( font );
  36.   }
  37.